package in.omerjerk.fullscreenimmersive;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;

public class SystemOverlayPermissionDialog extends DialogFragment {
    public Dialog onCreateDialog(Bundle bundle) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        builder.setMessage("Please allow system overlay permission for this app to work.").setPositiveButton("OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialogInterface, int i) {
                ((MainActivity) SystemOverlayPermissionDialog.this.getActivity()).requestSystemAlertPermission();
            }
        });
        return builder.create();
    }
}
